import os

from langchain_community.chat_models import ChatOpenAI
from langchain_community.llms import QianfanLLMEndpoint
# from langchain_bailian import Bailian


def baidu_llm():
    """
    百度大模型
    """
    # API_KEY = ""
    # SECRET_KEY = ""

    API_KEY = ""
    SECRET_KEY = ""

    os.environ["QIANFAN_AK"] = API_KEY
    os.environ["QIANFAN_SK"] = SECRET_KEY
    llm = QianfanLLMEndpoint(model="ERNIE-Speed-128K")
    return llm


# def qianwen_llm():
#     """
#     实验室通义千问
#     """
#     model = "Qwen1.5-7B-Chat"
#     temperature = 0.7
#     api_key = "EMPTY"
#     base_url = "http://192.168.0.194:20000/v1"
#     llm = ChatOpenAI(model=model, temperature=temperature, api_key=api_key, base_url=base_url, max_tokens=2048)
#     return llm


def qianwen_llm():
    """
    实验室通义千问32B
    """
    # model = "/nfs01/projects/50501243/s120212227183/code/qwen-1.5-32b/Qwen1.5-32B-Chat"
    # model = "Qwen-1.5-32b"
    # temperature = 0.7
    # api_key = "EMPTY"
    # base_url = "http://fushi.menglangpoem.cn:8099/v1"
    # llm = ChatOpenAI(model=model, temperature=temperature, api_key=api_key, base_url=base_url, max_tokens=2048)
    # return llm
    chat = ChatOpenAI(model="Qwen2-7B-Instruct", api_key="EMPTY", base_url="http://192.168.0.194:8001/v1")
    return chat

def bailian_llm():
    """
    """
    ACCESS_KEY_ID = ""
    ACCESS_KEY_SECRET = ""
    APP_ID = ""
    AGENT_KEY = ""
    # API_KEY = ""
    llm = Bailian(access_key_id=ACCESS_KEY_ID, access_key_secret=ACCESS_KEY_SECRET, app_id=APP_ID,
                  agent_key=AGENT_KEY)
    return llm
